<?php
class Masuk_model extends CI_Model 
{

	function __construct()
	{
		parent::__construct();
	}
	
	function doLogin($username,$sandi){
	$sql="SELECT *, pegawai.id_pegawai AS id_peg, pegawai.nama_lengkap AS nama FROM pengguna JOIN pegawai ON pegawai.id_pegawai = pengguna.id_pengguna WHERE username='".$username."' AND sandi='".$sandi."' LIMIT 1";
	//echo $sql;
		$query=$this->db->query($sql);
		if ($query->num_rows()>0){
			return $query->row_array();
		}else{
			return false;
		}	
	}
}